$(function () {
    $("#uname").text($.cookie('webgame'));    
});

function account() {
    var email = $("#email").val();
    var re = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    if (!re.test(email)) {
        alert("邮箱格式不正确！");
        return false;
    }
    var captcha = $("#captcha").val();
    if (captcha === '' || captcha.length < 5) {
        alert("验证密不能为空或小于5位");
        return false;
    }
    var box = $("#into_info_box");
    var html = '';
    $.ajax({
        type: 'get',
        url: domain + '/index.php?s=member/account',
        data: {'email': email, "captcha": captcha},
        dataType: 'json',
        success: function (data) {
            if (data['ret'] == 5) {
                alert(data['msg']);
                return;
            } else if (data['ret'] == 9) {
                alert(data['msg']);
                return;
            } else if (data['ret'] == 10) {
               window.location.href=domain+'/index.php?s=member/success_email'
            }
        }
    });

}

